<div class="row">
  <div class="col-xs-12">
    <table id="user-list" class="table table-hover table-striped table-bordered">
      <thead>
      <tr>
        <th class="center">帐号</th>
        <th class="align-middle">姓名</th>
        <th class="center">签到</th>
        <th class="hidden-480 center">借阅</th>
        <th class="hidden-480 center">还书</th>
        <th class="center">积分</th>
        <th class="hidden-480 center">手机号码</th>
        <th class="hidden-480 center">登记日期</th>
        <th class="hidden-480 center">打印</th>
        <th class="center">签到</th>
        <th class="hidden-480 center">奖励</th>
      </tr>
      </thead>
      <tbody>
      @foreach ($users as $user)
        <tr>
          <td class="center"><a href="{{route('bank.user.edit',array('uid'=>$user->id))}}">{{ $user->account }}</a></td>
          <td class="align-middle">{!! $user->present()->face !!} <a
                href="{{route('bank.user.show',array('uid'=>$user->id))}}" class="uid"
                data-id="{{ $user->id }}">{{ $user->name }}</a></td>
          <td class="center b-sign">{{ $user->summary->signs }}</td>
          <td class="hidden-480 center b-borrow">{{ $user->summary->borrows }}</td>
          <td class="hidden-480 center b-return">{{ $user->summary->returns }}</td>
          <td class="center b-point">{{ $user->summary->points }}</td>
          <td class="hidden-480 center">{{ $user->mobile }}</td>
          <td class="hidden-480 center">{{ date('Y-m-d',$user->created_at) }}</td>
          <td class="hidden-480 center"><a href=""><i class="ace-icon fa fa-print grey bigger-120"></i></a></td>
          <td class="center">{!! $user->present()->sign !!}</td>
          <td class="hidden-480 center">{!! $user->present()->award !!}</td>
        </tr>
      @endforeach
      </tbody>
    </table>
  </div>
</div>
@if( count($users) === 1)
  <input type="hidden" name="uid" value="{{$users[0]->id}}"/>
  <div class="row">
    <div class="col-xs-12">
      <h4 class="header smaller lighter red">已借书籍</h4>
      <table id="return-list" class="table table-hover table-bordered table-striped">
        <thead>
        <tr>
          <th class="center hidden-480" style="width:60px;">帐号</th>
          <th class="align-middle" style="width:90px;">姓名</th>
          <th style="width:80px;" class="center">封面</th>
          <th style="width:130px;" class="center hidden-480">ISBN</th>
          <th class="align-left align-middle">书名</th>
          <th class="center hidden-480" style="width:100px;">借阅日期</th>
          <th style="width:70px;" class="center hidden-480">书架号</th>
          <th style="width:60px;" class="center hidden-480">状态</th>
          <th class="center" style="width:70px;">操作</th>
        </tr>
        </thead>

        <tbody>
        @foreach ($users[0]->overdue as $borrow)
          <tr>
            <td class="center hidden-480"><a
                  href="{{route('bank.user.edit',array('uid'=>$borrow->user->id) )}}">{{ $borrow->user->account }}</a>
            </td>
            <td class="align-middle">{!! $borrow->user->present()->face !!}<a
                  href="{{route('bank.user.show',array('uid'=>$borrow->user->id))}}" class="uid"
                  data-id="{{ $borrow->user->id }}">{{ $borrow->user->name }}</a></td>
            <td class="center"><a href="{{route('book.borrows',array('bid'=>$borrow->book->id) )}}"><img
                    src="/assets/images/books/{{ $borrow->book->dbid }}.jpg" width="60%"></a></td>
            <td class="center hidden-480"><a
                  href="{{ route('book.edit',array('bid'=>$borrow->book->id) ) }}">{{ $borrow->book->isbn }}</a></td>
            <td class="align-left align-middle">{{ $borrow->book->title }}</td>
            <td class="center hidden-480">{{date('Y-m-d',$borrow->date_begin)}}</td>
            <td class="center hidden-480">{!! $borrow->book->present()->bookStore !!}</td>
            <td class="center hidden-480">{!! $borrow->present()->BorrowStatus !!}</td>
            <td class="center">
              @if ($borrow->status == 0)
                <button class="btn btn-xs btn-success no-border return" type="button" data-value="{{$borrow->id}}">
                  还书
                </button>
              @endif
            </td>
          </tr>
        @endforeach

        </tbody>
      </table>

    </div><!-- /.col -->
  </div><!-- /.row -->

@endif

@if( isset($books) && count($books)>0 )
  <div class="row">
    <div class="col-xs-12 col-md-offset-1 col-md-10">
      <h4 class="header smaller lighter green">书籍借阅</h4>
      <table id="book-list" class="table table-hover table-bordered table-striped">
        <thead>
        <tr>
          <th style="width:60px;" class="center">选择</th>
          <th style="width:80px;" class="center">封面</th>
          <th style="width:130px;" class="center hidden-480">ISBN</th>
          <th class="align-middle">书名</th>
          <th style="width:130px;" class="center hidden-480">作者</th>
          <th style="width:70px;" class="center hidden-480">书架号</th>
          <th style="width:70px;" class="center hidden-480">状态</th>
        </tr>
        </thead>

        <tbody>
        @foreach ($books as $book)
          <tr>
            <td class="center"><input name="bookid" value="{{$book->id}}" type="checkbox"
                                      class="ace ace-checkbox-2 input-lg" {{$book->status == 1?'disabled':''}}><span
                  class="lbl"> </span></td>
            <td class="center"><img src="/assets/images/books/{{ $book->dbid }}.jpg" width="60%"></td>
            <td class="center hidden-480"><a
                  href="{{ route('book.edit',array('bid'=>$book->id) ) }}">{{ $book->isbn }}</a></td>
            <td class="align-middle">{{ $book->title }}</td>
            <td class="center hidden-480">{{ $book->author }}</td>
            <td class="center hidden-480">{!! $book->present()->bookStore !!}</td>
            <td class="center hidden-480">{!! $book->present()->bookStatusPresenter !!}</td>
          </tr>
        @endforeach
        <tr>
          <td colspan="7">
            <button type="submit" class="btn btn-primary borrow">
              <i class="ace-icon fa fa-check"></i>
              <span class="">确 定</span>
            </button>
          </td>
        </tr>
        </tbody>
      </table>

    </div><!-- /.col -->
  </div><!-- /.row -->
@endif


